<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<script>
		var delcart = "<?php echo U('Cart/delCart');?>";
		var upcart = "<?php echo U('Cart/updateGoods');?>";
		//用于多选保存商品ID
				var goodsGid = [];
				<?php foreach ($carts['goods'] as $kkk=>$vvv){?>
					goodsGid.push('<?php echo $kkk;?>');
				<?php }?>
				console.log(goodsGid);
	</script>
	<link rel="stylesheet" href="http://127.0.0.1/vancl_php/Application/Index/View/css/shopcart.css" />
	<script type="text/javascript" src="http://127.0.0.1/vancl_php/Static/js/jquery-1.7.2.min.js"></script>
	<link rel="stylesheet" href="http://127.0.0.1/vancl_php/Static/css/hdjs.css" />
	<script type="text/javascript" src="http://127.0.0.1/vancl_php/Static/js/hdjs.min.js"></script>
	<script type="text/javascript" src="http://127.0.0.1/vancl_php/Application/Index/View/js/carts.js"></script>
	<script>
	$(function(){
		$('#cartFrom').submit(function(){
			    <?php if(isset($hd['session']['uid'])){ ?>
				return true
				<?php }else{ ?>
				hd_alert({
					message:'请您先登陆再提交订单',
					timeout:3
				})
				return false;
			<?php } ?>
		})
		})
	</script>
	<title>购物车</title>
	
</head>
<body>
	<div id="content">
		<!--头部-->
		<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<div id="head">
			<!--logo-->
			<a href="<?php echo U('Index/index');?>" class="logo"><img src="http://127.0.0.1/vancl_php/Application/Index/View/Img/vancl-logo.png" alt="" /></a>
			<!--logo-->
			<!--头部右边信息-->
			<div class="topRight">
				<a href="" class="helpcenter" >帮助中心</a>
				<div class="loginout">
					    <?php if(isset($hd['session']['username'])){ ?>
						您好，<?php echo $hd['session']['username'];?>
						<a href="<?php echo U('Login/loginout');?>">退出登录</a>
						｜
						<a href="<?php echo U('Login/index');?>">更换用户</a>
					<?php }else{ ?>
						您好,
						<a href="<?php echo U('Login/index');?>">请您登陆</a>
					<?php } ?>
				</div>

			</div>
			<!--头部右边信息-->
		</div>
		<!--头部结束-->

		<!--主体部分-->
		<div id="cartContent">
			<!--当前位置面包屑-->
			<div class="location">
				<span class="onemyshopcart">1.我的购物车</span>
				<span class="onemyshopcart" style="color:#666;">2.填写核对信息单</span>
				<span class="onemyshopcart" style="color:#666;">3.成功提交订单</span>
			</div>
			<!--当前位置面包屑-->
			<!--购物车头部-->
			<div class="carTop">
				<span class="carIcon"></span>
				<h2>我的购物车</h2>
			</div>
			<!--温馨提示-->
			<div class="prompt">
				<div class="leftTitle">
					<span>温馨提示：</span>
					<span style="color:#666;">1.选购清单中的商品无法保留库存，请您及时结算。2.商品的价格和库存将以订单提交时为准。3.促销活动满减优惠将均摊至商品小计中。 </span>
				</div>
			</div>
			<!--购物车头部结束-->

			<!--购物车主体-->
			<div class="cartCenter">
				<!--表单头-->
				<table>

					<tr class="tabletitle">
						<th>
							<input type="checkbox" name="selectall" checked="checked" />
						</th>
						<th align="left">全选</th>
						<th></th>
						<th>商品名称</th>
						<th>尺寸 </th>
						<th>单价  </th>
						<th>数量</th>
						<th>优惠 </th>
						<th>小计 </th>
						<th>操作</th>
					</tr>
					<form action="<?php echo U('Cart/shopConfirm');?>" id="cartFrom" method="post">
					    <?php if(!empty($carts['goods'])){ ?>
					<?php foreach ($carts['goods'] as $key=>$val){?>
					<tr class="shopList" cartid="<?php echo $key;?>">
						<td></td>
						<td align="left"><input type="checkbox" checked="checked" name="selectPro[]" value="<?php echo $key;?>" /></td>
						<td width="52">
							<a href="http://127.0.0.1/vancl_php/index.php/Index/Details/index/gid/<?php echo $val['id'];?>">
								<img src="http://127.0.0.1/vancl_php/<?php echo $val['img'];?>" alt="" width="48" height="48" />
							</a>
						</td>
						<td  style="margin-bottom:5px;">
							<a href="http://127.0.0.1/vancl_php/index.php/Index/Details/index/gid/<?php echo $val['id'];?>" style="padding-left:5px;"><?php echo $val['name'];?> <?php echo $val['options']['combinestr']['0'];?></a>
						</td>
						<td align="center">
							<?php echo $val['options']['combinestr']['1'];?>
						</td>
						<td align="center" >
							￥<?php echo $val['price'];?>
						</td>
						<td align="center" width="100">
							<a href="javascript:;" class="minus"></a>
							<input type="text" name="proNum"  value="<?php echo $val['num'];?>" class="proNum" />
							<a href="javascript:;" class="plus"></a>
						</td>
						<td align="center">
							-
						</td>
						<td align="center" class="goodsCurrnetCountMoney">
							￥<?php echo $val['total'];?>
						</td>
						<td align="center" valign="middle">
							<a href="" style="color:#444">收藏</a><br />
							<div class="msgDel">
								<p class="delTitle">您确定删除吗?</p>
								<p class="delBtns">
									<a href="javascript:;" class="del">删除</a>
									<a href="javascript:;" class="delcancl">取消</a>
								</p>
								<p class="dowarrow"></p>
							</div>
							<a href="javascript:;" class="delbox" style="color:#777;">删除</a>
						</td>
					</tr>
					<?php }?>
					<?php }else{ ?>
					<tr>
						<td colspan="10" height="50" style="font-size:20px;" align="center">购物车内还没有商品  <a href="<?php echo U('Index/index');?>" style="color:red;">去购物吧^_^</a></td>
					</tr>
					<?php } ?>
					<tr class="nogoods" style="display: none;">
						<td colspan="10" height="50" style="font-size:20px;" align="center">购物车内还没有商品  <a href="<?php echo U('Index/index');?>" style="color:red;">去购物吧^_^</a></td>
					</tr>
				</table>
				    <?php if(isset($carts)){ ?>
				<!--购物车按钮-->
				<div id="delCount">
					<div class="left">
						<label><input type="checkbox" checked="checked" id="checkall" /><span class="selectspan">全选</span></label>
							<div class="msgDel">
								<p class="delTitle">您确定删除吗?</p>
								<p class="delBtns">
									<a href="javascript:;" class="delb">删除</a>
									<a href="javascript:;" class="delcancl">取消</a>
								</p>
								<p class="dowarrow"></p>
							</div>
						<a href="javascript:;" id="delCartGoods" >删除</a>
						<div class="countNumFont">
							数量总计：<span class="numCount"><?php echo $carts['total_rows'];?>件</span>
						</div>
						<div class="fontPrice">
							产品金额总计(不含运费)：
							<span>￥<?php echo $carts['total'];?></span>
						</div>
					</div>
					<div class="right">
						<a href="<?php echo U('Index/index');?>" class="keepShop"><<继续购物</a>
						<!--<a href="<?php echo U('Cart/balance');?>" class="goSum">去结算>></a>-->
						<input type="submit" class="goSum" value="去结算>>>"  />
					</div>
					</form>
				</div>
				<?php } ?>
			</div>
			<!--购物车主体-->

		</div>
		<!--主体部分结束-->
		<!--页脚-->
		<div id="foot">
			<div class="copyright">
				Copyright 2007 - 2015 vancl.com All Rights Reserved 京ICP证100557号 京公网安备11010102000579号 出版物经营许可证新出发京批字第直110138号
			</div>
			<div class="gsjImg">
				<a href="" ><img src="http://127.0.0.1/vancl_php/Application/Index/View/img/cert-redlogo.png" alt="" /></a>
				<a href="" ><img src="http://127.0.0.1/vancl_php/Application/Index/View/img/cert-costumeorg.gif" alt="" /></a>
				<a href="" ><img src="http://127.0.0.1/vancl_php/Application/Index/View/img/cert-wsjybzzx.png" alt="" /></a>
			</div>
		</div>
		<!--页脚结束-->
	</div>

</body>
</html>
